package com.infoauto.opc.gateway.controller;

import com.infoauto.opc.gateway.entity.Result;
import com.infoauto.opc.gateway.entity.ResultCode;
import com.infoauto.opc.gateway.model.gtm4.Equipment;
import com.infoauto.opc.gateway.model.gtm4.EquipmentCompany;
import com.infoauto.opc.gateway.service.EquipmentCompanyService;
import com.infoauto.opc.gateway.service.EquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 厂家基础数据
 */

@CrossOrigin
@RestController
@RequestMapping("/equipmentCompany")
public class EquipmentCompanyController {
    @Autowired
    private EquipmentCompanyService service;

    /**
     * 根据所有厂家
     * @return
     */
    @RequestMapping(value="/selectList" ,method= RequestMethod.GET)
    public Result selectList(){
        try{
            List<EquipmentCompany> list = service.selectList();
            return new Result(ResultCode.SUCCESS,list);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
